﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace Glorysoft.EAP.Contracts.MESClient.Models
{
    public class Header
    {
        [JsonProperty(PropertyName = "LANGUAGE", NullValueHandling = NullValueHandling.Ignore)]
        public string LANGUAGE = "EN";
        [JsonProperty(PropertyName = "MESSAGENAME", NullValueHandling = NullValueHandling.Ignore)]
        public string MESSAGENAME { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string TRANSACTIONID { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string ORGRRN { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string ORGNAME { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string USERNAME { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string RESULT { get; set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string MESSAGERRN { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string RETURNCODE { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string RETURNMESSAGE { get; set; }
        public string RESULTMESSAGE { get; set; }
        public string SHOPNAME { get; set; }
    }

    public class Request
    {
        public Header Header = new Header() { USERNAME = "admin", ORGNAME = "SFE", ORGRRN = "10" };

        public object Body { get; set; }
        // public Header Header = new Header();
    }
    public class Requestobject
    {
        public Requestobject(string MESSAGENAME)
        {
            Request.Header.MESSAGENAME = MESSAGENAME;
            Request.Header.TRANSACTIONID = Guid.NewGuid().ToString();

        }
        public Request Request = new Request();
    }
  
    public class Response<T>
    {
        public Header Header { get; set; }

        public T Body { get; set; }
    }

    public class FeedAndMaterialResponse<T>
    {
        public Header Header { get; set; }
        public FeedAndMaterialBody Body { get; set; }
    }
    public class FeedAndMaterialBody
    {
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string RESULT { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public string RESULTMASSAGE { get; set; }
    }
    public class BaseResponse
    {
        public bool success { get; set; }//true or false
        public string msg { get; set; }
    }
    public class BaseResponses
    {
        public string success { get; set; }//true or false
        public string msg { get; set; }
    }
}
